import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import com.aa.RevStack;

public class StckApp {

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		StackX theStack = new StackX(10); // /jk
		theStack.push(10);
		theStack.push(40);
		theStack.push(60);
		theStack.push(80);

		while (!theStack.isEmpty()) {
			long value = theStack.pop();
			System.out.print(value + "\n");
		}

		RevStack res = new RevStack(10);
		String input, output;
		while (true) {
			System.out.print("Entersomething:");
			System.out.flush();
			input = getString();
			if (input.equals(""))
				break;
			System.out.print("soso:" + res.doRev(input));
		}

	}

	public static String getString() throws IOException {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		String s = br.readLine();
		return s;
	}

}
